app.controller('QrCode', function($element, $scope, $state, rest, user, tipService, h5Url,$rootScope) {
    var data = angular.copy($scope.ngDialogData, {});

    var hoststr = h5Url;
    hoststr += "?contractId=" + data.contractId;
    hoststr += "&openId=" + data.openId;
    
    $scope.qrcodeUrl = hoststr;
    $scope.title = data.title || "";

    $scope.sendUrlSMS = function () {
      rest.post({
          methodId: '4029',
          data: {"id": data.contractId},
          success: function(res) {
              if (res.code == 0) {
                  tipService.show("body", {
                      message: "租房合同短信发送成功！"
                  }, 3);
                  $location.path('/app/houseOwner/list');
                  flag = true;
              } else {
                  tipService.show("body", {
                      message: res.res.msg,
                      notice: "danger"
                  }, 3);
              }
          },
          error: function() {}
      })    	
    }
    
    $scope.refreshList = function(){
         $scope.confirm({});      
        $scope.closeThisDialog();
        $state.go('app.houseOwner.list');
    }

});